package book;

/**
 * Created with IntelliJ IDEA.
 * Description:书架
 * User: lenovo
 * Date: 2022-07-03
 * Time: 22:49
 */
public class Booklist {
    //最多可以放十本书
    private Book[] books = new Book[10];
//实时记录当前书架有多少书
private int uesdsize;
    public Booklist() {
        books[0] =new Book("三国演义","罗贯中","小说",19.0);
        books[1] = new Book("水浒传","施耐庵","小说",29.0);
        books[2] = new Book("红楼梦","曹雪芹","小说",9.0);
        uesdsize = 3;
    }

    /**
     *拿到这本书
     * @param pos 值必须合法
     * @return 是一本书
     */
    public Book getBook(int pos){
        return books[pos];

    }

    /**
     *增加一本书
     * @param pos 位置合法
     * @param book 是一本书
     */
    public void setBook(int pos,Book book){
        books[pos] = book;
    }

    /**
     * 实时获取当前的书数
     * @return
     */
    public int getUesdsize(){

        return uesdsize;
    }
    /**
     * 实时修改当前的数个数
     * @param size
     * @return
     */
    public void setUesdsiz(int size){

       uesdsize = size;
    }

}
